﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace HelenServer.FileStorage.Dal;

[Table("Attachment")]
public class Attachment
{
    [Key]
    public int Id { get; set; }

    [StringLength(64)]
    [Unicode(false)]
    public string FileId { get; set; } = null!;

    [StringLength(256)]
    [Unicode(false)]
    public string Url { get; set; } = null!;

    [StringLength(8)]
    [Unicode(false)]
    public string GroupName { get; set; } = null!;

    [StringLength(256)]
    [Unicode(false)]
    public string Name { get; set; } = null!;

    [StringLength(16)]
    [Unicode(false)]
    public string Extension { get; set; } = null!;

    public long Size { get; set; }

    public int AddedBy { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime AddedDate { get; set; } = DateTime.Now;

    [StringLength(16)]
    [Unicode(false)]
    public string Hash { get; set; } = null!;

    public bool Deleted { get; set; } = false;
}